<?php $this->pageTitle=Yii::app()->name; ?>
<div class="body-cont"> 
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'job-form',
	'enableClientValidation'=>true,
	'enableAjaxValidation'=>true,
	'htmlOptions' => array('enctype' => 'multipart/form-data',)
)); ?>
<?php if(Yii::app()->user->hasFlash('error1')):?>
    	<div class="info" style="color: red;">
        	<?php echo Yii::app()->user->getFlash('error1'); ?>
    	</div>
	<?php endif; ?>

<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'timeend'); ?>
		<?php echo CHtml::dropDownList('timeend','', Yii::app()->getModule('job')->getTimeEnd(),array('prompt' => 'Chọn khoảng thời gian',)); ?>
		<?php echo $form->error($model,'timeend'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'budget_id'); ?>
        <?php echo CHtml::dropDownList('currency',$model->budget->currency_id,JobModule::getJobCurrency(),array(
                    'ajax' => array(
                    'type'=>'POST', //request type
                    'url'=>CController::createUrl('/job/create/ajaxcurrency'), //url to call.
                    //Style: CController::createUrl('currentController/methodToCall')
                    'update'=>'#'.CHtml::activeId($model,'budget_id'), 
                    )));  
            
?>
		<?php echo JobModule::getValueBudget($model->budget_id); ?>
		<?php echo $form->error($model,'budget_id'); ?>
	</div>
    <div class="row">
          <?php echo $form->labelEx($model,'statuspost'); ?>
          <?php echo $form->checkBox($model,'statuspost'); ?>
        <?php echo $form->error($model,'statuspost'); ?>

    </div>
	<div class="row">
		<?php echo $form->labelEx($model,'jobdesc'); ?>
		<?php echo $form->textArea($model,'jobdesc',array('rows'=>10, 'cols'=>80)); ?>
		<?php echo $form->error($model,'jobdesc'); ?>
	</div>
        Chú ý: Bạn không được đăng thông tin cá nhân nào trên website này!!

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
</div>